$(function(){
	ShowTabl();
});
function LabelingSel(){
	ShowTabl();
}

function ShowTabl(){
	//获取审批状态
	var shop = document.getElementById("shopid").value;
	//alert(shop);
	shop = encodeURI(encodeURI(shop));
	var url = "labelling/all.do?shopname="+shop;
	
	var tableSource = new $.jqx.dataAdapter({
		dataType: "json",
		dataFields:[
		    { name: "shopname",type:"string"},
		    { name: "username",type:"string"},
		    { name: "orderid", type: "string" },
		    { name: "goods_name", type: "string" },
		    { name: "actual_subtotal", type: "double" },
		    { name: "tagsbarcode1", type: "string" },
		    { name: "tagsbarcode2", type: "string" },
		    { name: "tagsstartdate",type:"date"},
		    { name: "tagsenddate", type: "date" },
		    { name: "isdelete", type: "int" }
		],
		//id: "id",	
		url:url
	});
	ShowTableData(tableSource);
	
}
function ShowTableData(tableSource){
	$("#dataTable").jqxDataTable({
		width: "100%",
        source: tableSource,
        pageable: true,
        pageSize: 20,
        serverProcessing: true,
        pagerButtonsCount: 10,
        columnsResize: true,
        sortable: true,
        columns: [
            { text: "序号", width: 50, cellsRenderer: function(row) { return (row + 1).toString(); } },
            { text: "商店名称",dataField:"shopname"},
            { text: "用户名",dataField:"username"},
            { text:	"订单号",dataField:"orderid"},
            { text: "商品名称",dataField:"goods_name"},
            { text: "价格",dataField:"actual_subtotal"},
            { text: "顶部二维码",dataField:"tagsbarcode1"},
            { text: "底部二维码",dataField:"tagsbarcode2"},
            { text: "标签开始时间",dataField:"tagsstartdate",
            	cellsRenderer: function(row, column, value, rowData) {
            		return format(value, "Y-M-D H:I");
            	}
            },
            { text: "标签结束时间",dataField:"tagsenddate",
            	cellsRenderer: function(row, column, value, rowData) {
            		return format(value, "Y-M-D H:I");
            	}
            },
            { text: "是否删除",dataField:"isdelete"}
        ],
	});
}



